package com.kvn.blade.core.decoder;

import java.nio.charset.Charset;

/**
 * @author wzy
 * @date 2017年11月17日 上午11:04:40
 */
public class ByteBufXmlDecoder implements Decoder {
    private static final XmlDecoder xmlDecoder = new XmlDecoder();

	@Override
	public <T> T decode(Object arg, Class<T> returnClass) {
		byte[] msg = (byte[]) arg;
		String rlt = new String(msg, Charset.forName("UTF-8"));
		System.out.println("ByteBufXmlDecoder==>" + rlt);

		return xmlDecoder.decode(rlt, returnClass);
	}

}
